/*
  ==============================================================================

  This is an automatically generated file created by the Jucer!

  Creation date:  4 Jun 2008 1:17:06 pm

  Be careful when adding custom code to these files, as only the code within
  the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
  and re-saved.

  Jucer version: 1.11

  ------------------------------------------------------------------------------

  The Jucer is part of the JUCE library - "Jules' Utility Class Extensions"
  Copyright 2004-6 by Raw Material Software ltd.

  ==============================================================================
*/

#ifndef __JUCER_HEADER_KETONALFORMEDITOR_KETONALFORMEDITOR_DE1D15CA__
#define __JUCER_HEADER_KETONALFORMEDITOR_KETONALFORMEDITOR_DE1D15CA__

//[Headers]     -- You can add your own extra header files here --
#include "juce.h"
#include "KetonalConfig.h"
#include "formElement.h"
class KetonalFormEditorWindow;
//[/Headers]



//==============================================================================
/**
                                                                    //[Comments]
    An auto-generated component, created by the Jucer.

    Describe your class and how it works here!
                                                                    //[/Comments]
*/
class KetonalFormEditor  : public Component,
                           public ButtonListener
{
public:
    //==============================================================================
    KetonalFormEditor (KetonalConfig *_c, KetonalFormEditorWindow *_p);
    ~KetonalFormEditor();

    //==============================================================================
    //[UserMethods]     -- You can add your own custom methods in this section.
	void mouseDrag (const MouseEvent& e);
	void mouseDown (const MouseEvent& e);
	void removeElement (int n);
	void repositionElements();
	void addElement();
    //[/UserMethods]

    void paint (Graphics& g);
    void resized();
    void buttonClicked (Button* buttonThatWasClicked);

    // Binary resources:
    static const char* listadd_png;
    static const int listadd_pngSize;
    static const char* listremove_png;
    static const int listremove_pngSize;

    //==============================================================================
    juce_UseDebuggingNewOperator

private:
    //[UserVariables]   -- You can add your own custom variables in this section.
	ComponentDragger myDragger;
	int nElements;
	OwnedArray <formElement> formElements;
	KetonalConfig *config;
	KetonalFormEditorWindow *parent;
    //[/UserVariables]

    //==============================================================================
    ImageButton* addFormElement;

    //==============================================================================
    // (prevent copy constructor and operator= being generated..)
    KetonalFormEditor (const KetonalFormEditor&);
    const KetonalFormEditor& operator= (const KetonalFormEditor&);
};


#endif   // __JUCER_HEADER_KETONALFORMEDITOR_KETONALFORMEDITOR_DE1D15CA__
